import request from '@/utils/request'

// api地址
const api = {
	tiku_list: 'dati.game/tiku_list',
	game_info: 'dati.game/game_info',
	getUserAnswer: 'dati.game/get_game_tiku_detail',
	add: 'dati.game/add',
	robotAdd: 'dati.game/robotAdd',
	update_tiku: 'dati.game/update_tiku',
	update_tiku_robot: 'dati.game/update_tiku_robot',
	getResult: 'dati.game/getResult',
	getCountdown:'dati.game/getCountdown',
	logout: 'dati.game/logout',
}
export function getCountdown() {
	return request.get(api.getCountdown)
}
export function logout(id) {
	return request.get(api.logout, {
		id
	})
}
export function getResult(id) {
	return request.get(api.getResult, {
		id
	})
}

export function tiku_list(param, option) {
	return request.get(api.tiku_list, param, option)
}
export function getUserAnswer(param, option) {
	return request.get(api.getUserAnswer, param, option)
}

export function game_info(param, option) {
	return request.get(api.game_info, param, option)
}
export const robotAdd = (gameId,data) => {
	return request.post(api.robotAdd, {
		gameId,
		form: data
	})
}
export const add = (data) => {
	return request.post(api.add, {
		form: data
	})
}
export const update_tiku = (data) => {
	return request.post(api.update_tiku, {
		form: data
	})
}
export const update_tiku_robot = (data) => {
	return request.post(api.update_tiku_robot, {
		form: data
	})
}